package day16_Runnable.作业.作业2;
//打印数字线程
public class NumberPrinter extends Thread{
    private Printer p;
    public NumberPrinter (Printer p){
        this.p=p;
    }
    public void run(){
        for (int i = 1; i <=52 ; i++) {
            try {
                p.print(i);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
